package demo;

import java.net.URLEncoder;
import java.util.Scanner;

/**
 * @author or2
 * @Description
 * @create 2021年09月07日 时间: 16:54
 */
public class URLString {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        StringBuilder stringBuilder = new StringBuilder();

        while (true) {
            String nextLine = scanner.nextLine();
            if (nextLine.equals("exit")) {
                break;
            }
            stringBuilder.append(nextLine);
        }

        String ans = stringBuilder.toString();
        System.out.println(ans);
        String encode = URLEncoder.encode(ans);
        System.out.println(encode);
    }
}
